﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using SGRapidForm.Permission.Entity;
using SGRapidForm.Common;

namespace SGRapidForm.Permission.Service.Interface
{
    [ServiceContract(Namespace = "http://www.solutiongear.net/SGRapidForm/")]
    public interface IUserService
    {
        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        List<UserDetails> User_FilteredGetAll(String filterConditions);


        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_Add(UserDetails userDetails);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_Delete(string keyid);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_BulkDelete(string keyids);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_Update(UserDetails userDetails);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_ChangePassword(string keyid, string password);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_BulkEdit(string columnSettings, string keyids);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        UserDetails User_GetByKeyid(string keyid);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        List<UserDetails> User_GetAll();

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        List<UserDetails> User_PagingGet(Int32 startRecord, Int32 maxRecords, String sortColumns, String filterConditions);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        int User_PagingGetCount(String filterConditions);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_IsExist(string userName);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        UserDetails User_GetByName(string userName);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_HasPagePermission(string userKeyid, string pageCode);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_HasButtonPermission(string userKeyid, string pageCode, string serverSideMethod);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        List<ModuleEntity> User_GetModuleBy(string userKeyid);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        List<PageEntity> User_GetPageBy(string userKeyid, string moduleKeyid);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        List<PageEntity> User_GetSecondStagePageBy(string userKeyid, string moduleKeyid);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        List<ButtonEntity> User_GetButtonBy(string userKeyid, string pageCode);

        /// <summary>
        /// 导入用户数据
        /// </summary>
        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_ImportDate(String userName,String password ,String realName,String mobilePhone,String email,bool isApproved,bool isLockedOut,String remark,String createName,DateTime createDate,String deptName,String roleName);

        /// <summary>
        /// 清空用户数据（导入前）
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        bool User_Clear();

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        List<UserDetails> User_GetUserByButtonPermission(string pagecode, string buttoncode);

        [OperationContract]
        [FaultContract(typeof(ServiceExceptionDetail))]
        List<UserDetails> User_GetUserByDeptCode(string deptcode);
    }
}
